This invention relates to calibrating digital cameras for single and stereo installations in general, and more specifically to determining the locations of points of interest on an image of a calibration object for application in calibrating the camera.
A great number of tasks can be aided by the use of accurate digital cameras. Camera accuracy is particularly important in machine vision and in stereovision. Accurately calibrated cameras can be used in machine vision, for example, for guiding equipment and for quality control. Accurately calibrated stereo cameras can be used, for example, for capturing the shape of three dimensional objects, for distinguishing foreground and background subjects and for tracking the three dimensional movement of machinery or people. For stereovision, the cameras must be calibrated individually and also to each other.
Digital cameras may suffer from any of a variety of different defects that reduce the accuracy of the image obtained. Many of the defects reside in the photosensor array which is typically an array of CCDs (Charge-Coupled Devices) or an array of CMOS (Complementary Metal Oxide Semiconductor) photodetectors. Some of the primary sources of errors are defects in the individual photo detecting elements of the photosensor array, inaccuracies in the orientation of the photosensor array within the camera body, inaccuracies in the relationship between the plane of the photosensor array and the optical axis of the camera lens and distortions, particularly radial and tangential distortions, in the lens. Other sources of errors can also occur. Most or all of these error sources can be compensated or corrected through careful calibration. This allows less expensive photosensor arrays, cameras and lenses to be used than previously possible. Stereovision systems require at least two cameras that both view the same object. Through triangulation of images obtained by the two cameras, the three dimensional position of an object in the field of view of the two cameras can be determined. In order to do this, the relative position of the cameras and the elements of each camera""s optical sensor array must be accurately known. Calibration can be used to compensate for misalignment of the cameras or for inconsistencies in the construction between the two cameras.
Calibration algorithms have been developed for digital cameras which use one or more images of a calibration object taken by the digital camera to develop a calibration model. However, in most such algorithms, a human must help identify the position of the calibration object and the general location of its important features in each taken image. This is a tedious and time consuming task especially when applied to multiple images. It also requires a display and human interface with sufficient resolution for the operator to see and indicate the positions of the important calibration object features. Accordingly, the process is more difficult to apply to portable equipment. Finally, it requires some expertise and so is difficult to perform by other than experienced users.
The present invention allows for the locations of points of interest in a calibration object in a calibration image for a digital camera to be identified. The image is an array of pixels corresponding to the calibration object, which has a known reference pattern. In a preferred embodiment, the invention includes receiving an array of pixels produced by a camera, classifying each pixel of the image as light or dark, extracting contours from the image by identifying lines between light and dark pixels, comparing the extracted contours to the shapes of the known reference pattern, and identifying the shapes of the known reference pattern in the image using the extracted contours. Preferably, the image is a color image, and the color information in the pixels of the image are converted into gray scale values to render the image as a gray scale image before the pixels are classified.
Classifying each pixel includes applying a brightness threshold to each pixel of the image to classify those pixels having a brightness greater than the threshold as light and those below the threshold as dark. The brightness threshold is determined by the mean brightness value of the pixels in the image reduced by a portion of the highest brightness value of any pixel. To extract the contours, the Douglas-Peucker algorithm is applied to approximate a simple polygonal shape. This comprises drawing a connected arc along a contour such that the contour lies within a distance threshold of the closest line of the arc and adaptively modifying the line distance threshold to obtain the calibration object shapes.